	<?php 
		$CAT_PRIZE = $this->week_prize_entity->init('id', $_POST['cat_id']);
		$listPrize = $this->week_prize_entity->getArrayListOfPrize($_POST['cat_id']);
	?>
	
	<div class="clrboth"></div>
		<?php $buttons = array('buttons'=>array("Add#add_new_prize({$CAT_PRIZE->getId()});") );?>
		<?php $this->load->view('admin/partials/buttons', $buttons ); ?>
	<div class="clrboth"></div>
	
	<input type="hidden" name="cat_id" id="cat_id" value="<?php echo $_POST['cat_id'];?>" />
	
<table>	
	<thead>
		<th><div class="grid1"><span class="bold" style="font-weight:bold;">Rank</span></div></th>
		<th><div class="grid1"><span class="bold" style="font-weight:bold;">Prize</span></div></th>
		<th><div class="grid1"><span class="bold" style="font-weight:bold;">Image</span></div></th>
		<th><div class="grid1"><span class="bold" style="font-weight:bold;">Logo</span></div></th>
		<th><div class="grid1"><span class="bold" style="font-weight:bold;">Value</span></div></th>
		<th><div class="grid1"><span class="bold" style="font-weight:bold;">Delivery Status</span></div></th>
		<th><div class="grid2"><span class="bold" style="font-weight:bold;">Proof</span></div></th>
		<th><div class="grid2"><span class="bold" style="font-weight:bold;">Username</span></div></th>
		<th><div class="grid2"><span class="bold" style="font-weight:bold;">Manage</span></div></th>
	</thead>
	<div class="clrboth"></div>
	<tbody>
		<?php foreach( $listPrize as $item ): ?>
			<?php 
				$PRIZE = $this->week_prize_entity->init('id',$item->id);
				$USER = $this->week_prize_entity->getUserObjectWithRank($PRIZE->getRank(), $PRIZE->getTournamentId(), $PRIZE->getCategoryId());
			?>
		<tr>	
			<td><div class="grid1"><?php echo $PRIZE->getRank(); ?></div></td>
			<td><div class="grid1"><?php echo $PRIZE->getPrizeName(); ?></div></td>
			<td><div class="grid1"><?php echo thumb($PRIZE->getPrizeImage(),40,40); ?></div></td>
			<td><div class="grid1"><?php if($PRIZE->getLogo()) echo thumb($PRIZE->getLogoImage(),30,30); ?></div></td>
			<td><div class="grid1"><?php echo $PRIZE->getValue(); ?></div></td>
			<td><div class="grid1"><?php echo $PRIZE->getDeliveryStatus(); ?></div></td>
			<td><div class="grid2"><?php echo thumb($PRIZE->getProofImage(),40,40,true); ?></div></td>
			<td><div class="grid2">
				<?php if($USER) : ?>
					<?php echo $USER->getUserName(); ?> <br/>
					<?php $info =$this->week_prize_entity->getPersonWithARank($PRIZE->getRank(), $PRIZE->getTournamentId(), $PRIZE->getCategoryId()) ;?>
					Point: <?php echo $info['point']; ?>
				<?php endif ;?>
			</div></td>
			
			<td><div class="grid2">
				<a href="javascript:void(0);" onclick="prize_edit(<?php echo $PRIZE->getId();?>,<?php echo $PRIZE->getCategoryId();?>)"><?php echo lang('dataman.edit');?></a>
				&nbsp;|&nbsp;
				<a href="javascript:void(0);" onclick="prize_delete(<?php echo $PRIZE->getId();?>,<?php echo $PRIZE->getCategoryId();?>)" >Delete</a>
				<?php echo loader_image("id=\"loader_image_prize_{$item->id}\" class=\"hidden\"");?>
			</div></td>
			<div class="clrboth"></div>
		</tr>		
		<?php endforeach; ?>
	</tbody>
</table>		

